<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="易控" />
<meta name="description" content="深圳市天下都信网络安全技术有限公司地址" />
<title>深圳市天下都信网络安全技术有限公司</title>
<style type="text/css">
    {literal}
    html,body{margin:0;padding:0;}
    .iw_poi_title {color:#CC5522;font-size:14px;font-weight:bold;overflow:hidden;padding-right:13px;white-space:nowrap}
    .iw_poi_content {font:12px arial,sans-serif;overflow:visible;padding-top:4px;white-space:-moz-pre-wrap;word-wrap:break-word}
    {/literal}
</style>
    {literal}
    <script type="text/javascript">
        var accessKey = "C7jpGuQs2jDt9mGFEysmBshrwa7oj6df";
        var protocol = (("https:" == document.location.protocol) ? "&s=1" : "");
        var bdapiurl = '//api.map.baidu.com/api?ak='+ accessKey +'&v=2&services=true' + protocol;
        document.write(unescape("%3Cscript src='" + bdapiurl +"' type='text/javascript'%3E%3C/script%3E"));
    </script>
    {/literal}
<!--<script type="text/javascript" src="//api.map.baidu.com/api?key=&v=1.1&services=true&s=1"></script>-->
    <!--<script type="text/javascript" src="//api.map.baidu.com/api?ak=XLxhni8lajTz3YyDDflfXg5Uu9CmMxj1&v=2&services=true&s=1"></script>-->
    </head>
    <body>
    <div style="width:720px;height:410px;border:#ccc solid 1px;" id="dituContent"></div>
    </body>
    <script type="text/javascript">
        {literal}
        function initMap(){
            setMapSize();
            createMap();
            setMapEvent();
            addMapControl();
            addMarker();
        }

        function getQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;
        }

        function setMapSize() {
            var h = getQueryString('h');
            var w = getQueryString('w');

            var obj = document.getElementById('dituContent');
            obj.style.width = w + 'px';
            obj.style.height = h + 'px';
        }

        function createMap(){
            var map = new BMap.Map("dituContent");
            var point = new BMap.Point(113.946559,22.546184);
            map.centerAndZoom(point,17);
            window.map = map;
        }


        function setMapEvent(){
            map.enableDragging();
            map.enableScrollWheelZoom();
            map.enableDoubleClickZoom();
            map.enableKeyboard();
        }


        function addMapControl(){

      var ctrl_nav = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE});
      map.addControl(ctrl_nav);

      var ctrl_ove = new BMap.OverviewMapControl({anchor:BMAP_ANCHOR_BOTTOM_RIGHT,isOpen:1});
      map.addControl(ctrl_ove);

      var ctrl_sca = new BMap.ScaleControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT});
      map.addControl(ctrl_sca);
        }

        var content = "深圳市南山区深南大道9966号威盛科技大厦5楼<br />" +
                        "联系电话：400-777-9688<br />" +
                        "<img src='/static/v1/images/qrcode.png'>";

        var markerArr = [{title:"深圳市天下都信网络安全技术有限公司",content:content ,point:"113.946559|22.546184",isOpen:0,icon:{w:21,h:21,l:0,t:0,x:6,lb:5}}
         ];

        function addMarker(){
            for(var i=0;i<markerArr.length;i++){
                var json = markerArr[i];
                var p0 = json.point.split("|")[0];
                var p1 = json.point.split("|")[1];
                var point = new BMap.Point(p0,p1);
          var iconImg = createIcon(json.icon);
                var marker = new BMap.Marker(point,{icon:iconImg});
          var iw = createInfoWindow(i);
          var label = new BMap.Label(json.title,{"offset":new BMap.Size(json.icon.lb-json.icon.x+10,-20)});
          marker.setLabel(label);
                map.addOverlay(marker);
                label.setStyle({
                            borderColor:"#808080",
                            color:"#333",
                            cursor:"pointer"
                });

          (function(){
            var index = i;
            var _iw = createInfoWindow(i);
            var _marker = marker;
            _marker.addEventListener("click",function(){
                this.openInfoWindow(_iw);
              });
              _iw.addEventListener("open",function(){
                _marker.getLabel().hide();
              })
              _iw.addEventListener("close",function(){
                _marker.getLabel().show();
              })
            label.addEventListener("click",function(){
                _marker.openInfoWindow(_iw);
              })
            if(!!json.isOpen){
              label.hide();
              _marker.openInfoWindow(_iw);
            }
          })()
            }
        }

        function createInfoWindow(i){
            var json = markerArr[i];
            var iw = new BMap.InfoWindow("<b class='iw_poi_title' title='" + json.title + "'>" + json.title + "</b><div class='iw_poi_content'>"+json.content+"</div>");
            return iw;
        }

        function createIcon(json){
            var icon = new BMap.Icon("/static/v1/images/contact/baidu_map_icon.png", new BMap.Size(json.w,json.h),{imageOffset: new BMap.Size(-json.l,-json.t),infoWindowOffset:new BMap.Size(json.lb+5,1),offset:new BMap.Size(json.x,json.h)})
            return icon;
        }

        initMap();
        {/literal}
    </script>
    </html>
